package com.fhz.mvvmtest.food2.model;

import androidx.lifecycle.LiveData;

import com.fhz.mvvmtest.base.IModel;
import com.fhz.mvvmtest.food.entity.Food;
import com.fhz.mvvmtest.food2.Api;
import com.fhz.mvvmtest.food2.RetrofitFactory;

/**
 * 时间:11/15/21
 *
 * @author msfeng
 * 简述: 请求数据
 */
public class FoodModel2 implements IModel {

    //本地或网络
    public LiveData<Food> getFood(){
        //网络请求
        Api api = RetrofitFactory.getRetrofitFactory().create(Api.class);
        LiveData<Food> food2 = api.getFood2();
        return food2;
    }
}
